<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>异常报告统计管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
	$(document).ready(function() {
		$(document).on("click","#btnReset",function(){
			$("#schoolCodeId").val("");
			$("#schoolCodeName").val("");
			$("#classCodeId").val("");
			$("#classCodeName").val("");
			$("#stuGrade").val("").select2();
			$("#stuCode").val("");
			$("#beginDate").val("");
			$("#endDate").val("");;
		});
	});
	function page(n,s){
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
       	return false;
    }
	function down(){
		layer.confirm('确认要导出体检统计报表吗？', {
			btn : [ '确认', '取消' ]
		}, function() {
			$("#searchForm").attr("action", "${ctx}/childtijianrecord/childTijianRecord/exportExcel");
			$("#searchForm").submit();
			layer.msg('正在导出', {icon: 1});
			$("#searchForm").attr("action", "${ctx}/childtijianrecord/childTijianRecord/list2");
		}, function() {

		});
	}
</script>
<style type="text/css">
	.minWidth {
		min-width: 177px;
	}
	.autoWidth {
	    width: auto;
	}
	.select2-choices{
	    border-radius: 4px;
	}
	#contentTable td ,#contentTable th{
		text-align: center;
		padding: 2px 10px;
	}
	#contentTable tbody tr td{
		font-size: 14px;
	}
</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="javascript:;">异常报告统计</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="childTijianRecord" action="${ctx}/childtijianrecord/childTijianRecord/list2" method="post" class="breadcrumb form-search" autocomplete="off">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div class="breadcrumb">
			<table class="table table-bordered">
				<tr>
					<th>学校：</th>
					<td>
						<%-- <form:input path="school.schName" id="schoolName" class="span2 minWidth"/> --%>
						<sys:treeselect2 id="schoolCode" name="schoolCode" value="${childTijianRecord.schoolCode}" labelName="schoolName" labelValue="${childTijianRecord.schoolName}"
			                title="学校" url="/sysschool/sysSchool/schTreeData" cssClass="input-medium" layer = "true" notAllowSelectParent="true" notAllowSelectRoot="true"/>
					</td>
					<%-- <th>班级：</th>
					<td>
						<form:input path="student.className" id="className" class="span2 minWidth"/>
						<sys:treeselect2 id="classCode" name="classCode" value="${childTijianRecord.classCode}" labelName="className" labelValue="${childTijianRecord.className}"
			                title="班级" url="/classinfo/classInfo/classTreeData" cssClass="input-medium" layer = "true" notAllowSelectParent="true" notAllowSelectRoot="true"/>
					</td> --%>
					<th>年级：</th>
					<td>
						<form:select id="stuGrade" path="student.stuGrade" class="span2 minWidth" >
							<form:option value="" label="--请选择--"/>
							<form:options items="${fns:getDictList('stu_grade')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
					<th>班级：</th>
					<td>
						<sys:treeselect2 id="classCode" name="classCode" value="${childTijianRecord.classCode}" labelName="className" labelValue="${childTijianRecord.className}"
										 title="班级" url="/classinfo/classInfo/classTreeData" cssClass="input-medium" layer = "true" notAllowSelectParent="true" notAllowSelectRoot="true"/>
					</td>
				</tr>
				<tr>
					<th>体检起始日期：</th>
					<td>
						<input name="beginDate" id ="beginDate" type="text" maxlength="20" class="input-medium Wdate"
							value="<fmt:formatDate value="${childTijianRecord.beginDate}" pattern="yyyy-MM-dd"/>"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
					</td>
					<th>体检截止日期：</th>
					<td>
						<input name="endDate" id ="endDate" type="text" maxlength="20" class="input-medium Wdate"
							value="<fmt:formatDate value="${childTijianRecord.endDate}" pattern="yyyy-MM-dd"/>"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
					</td>
				</tr>
			</table>
		</div>
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<input id="btnReset" type="button" class="btn btn-primary" value="重置"/>
		<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
		<input id="btnPrint" class="btn btn-primary" type="button" value="打印"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>班级</th>
				<th>姓名 </th>
				<th>性别</th>
				<th>内、外科</th>
				<th>口腔</th>
				<th>眼科</th>
				<th>结果</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${map}" var="maps" begin="0" varStatus="status">
			<tr>
			    <td>
		            ${fns:getDictLabel(maps.STU_GRADE,'stu_grade','')}${maps.CLASS_NAME}
		        </td>
			    <td>
			        ${maps.STU_NAME}
			    </td>
			    <td>
			        ${fns:getDictLabel(maps.GENDER,'sex','')}
			    </td>
			    <td>

			    </td>
			    <td>
			        <c:if test="${not empty maps.LEFT_LOWER_MOUTH}">
			                                左上${maps.LEFT_LOWER_MOUTH}
			        </c:if>
			        <c:if test="${not empty maps.LEFT_UPPER_MOUTH}">
			                                左下${maps.LEFT_UPPER_MOUTH}
			        </c:if>
			        <c:if test="${not empty maps.RIGHT_LOWER_MOUTH}">
			                                右上${maps.RIGHT_LOWER_MOUTH}
			        </c:if>
			        <c:if test="${not empty maps.RIGHT_UPPER_MOUTH}">
			                                右下${maps.RIGHT_UPPER_MOUTH}
			        </c:if>
			        <c:choose>
			           <c:when test="${empty maps.LEFT_LOWER_MOUTH && empty maps.LEFT_UPPER_MOUTH && empty maps.RIGHT_LOWER_MOUTH && empty maps.RIGHT_UPPER_MOUTH}">
				       </c:when>
				       <c:otherwise>龋齿</c:otherwise>
			        </c:choose>
			    </td>
			    <td>
			        <c:choose>
				       <c:when test="${(maps.REAL_LEFT_EYE >= '5.0' || empty maps.REAL_LEFT_EYE) && (maps.REAL_RIGHT_EYE >= '5.0' || empty maps.REAL_RIGHT_EYE)}">
				       </c:when>
				       <c:otherwise>
				                         左眼${maps.REAL_LEFT_EYE} 右眼${maps.REAL_RIGHT_EYE}
				       </c:otherwise>
			        </c:choose>
			    </td>
			    <td>
			        ${maps.STATUS}
			    </td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>